import os
import fileinput
import sys


if len(sys.argv)<4:
    print('Usage: countvector.py filename foldername prefix')
    quit()
else:
    print('Parameters OK')


vfile = sys.argv[1]
folder= sys.argv[2]
prefix= sys.argv[3]




vs=fileinput.input(vfile)
cnt=0;

if not os.path.exists(folder):
    os.mkdir(folder)

for line in vs:
#    print("lines " + str(cnt))
    cnt=cnt+1
    sfname=folder+'/'+ prefix +str(cnt)+'.txt'
#    if not os.
    f=open(sfname, "w")
    f.writelines(line)
